import axios from 'axios'
import { useData } from '@sker/runtime'
import { z } from 'zod'
import { toSuccess } from '@sker/core'
export default async () => {
    const input = z.object({
        type: z.optional(z.number()),
        page: z.optional(z.number()),
        psize: z.optional(z.number())
    })
    const body = input.parse(useData())
    body.page = body.page || 1;
    body.type = body.type || 1;
    body.psize = body.psize || 20;
    const url = `https://live.kuaishou.com/live_api/category/data?type=1&page=${body.page}&pageSize=${body.psize}`
    const res = await axios.get(url).then(res => res.data)
    return toSuccess(res)
}

